package com.taotao.tools.core.exception;

import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 根异常
 * </p>
 *
 * @author youbeiwuhuan
 * @version V1.0
 * @since 2019/6/12 9:44
 */
@Getter
@Setter
public class TaotaoToolsException extends RuntimeException {

    /**
     * 错误码
     */
    protected Integer code;
    /**
     * 附带数据
     */
    protected Object data;

    public TaotaoToolsException(String msg) {
        super(msg);
    }

    public TaotaoToolsException(int code, String msg) {
        super(msg);
        this.code = code;
    }

    public TaotaoToolsException(int code, String msg, Object data) {
        super(msg);
        this.data = data;
        this.code = code;
    }

    protected TaotaoToolsException(int code, Object data, Throwable cause) {
        super(cause);
        this.code = code;
        this.data = data;
    }

    protected TaotaoToolsException(int code, Throwable cause) {
        super(cause);
        this.code = code;
    }

    protected TaotaoToolsException(Throwable cause) {
        super(cause);
    }


//    @Override
//    public synchronized Throwable fillInStackTrace() {
//        return this;
//    }
}
